<template>
  <view :style="colorStyle">
    <view class="infobox1">
      <u-parse
        :content="info.content"
        v-if="options.title !== '分销规则'"
      ></u-parse>
      <u-parse :content="rule" v-else></u-parse>
    </view>
  </view>
</template>

<script>
import { protocolInfo } from "@/servers/servers.js";
import { HTTP_STATUS } from "@/servers/config.js";
import colors from "@/mixins/color";
import { getStorage, getToken } from "../../utils/storage";
export default {
  mixins: [colors],
  data() {
    return {
      info: {},
      rule: getStorage("rule"),
      options: {},
    };
  },
  async onLoad(options) {
    console.log(options);
    this.$set(this, "options", options);
    uni.setNavigationBarTitle({
      title: options.title,
    });
    console.log(this.rule);
    if (this.options.key) {
      this.protocolInfo();
    }
  },
  methods: {
    async protocolInfo() {
      let { data } = await protocolInfo({
        code: this.options.key,
      });
      if (data.code == HTTP_STATUS.RUSELT_SUCCESS) {
        let info = data.data;
        this.info = info;
      }
    },
  },
};
</script>
<style>
/* #ifdef MP-WEIXIN */
page {
  background: #f5f5f5;
}

/* #endif */
</style>
<style lang="scss" scoped>
page {
  background: #f5f5f5;
}

.infobox1 {
  padding: 30rpx;
}
</style>
